package com.cskaoyan.support;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class ProxySupport {

    //执行的是委托类的方法
    public void invoke(Method method,Object[] args,Object object){
        try {
            method.invoke(object, args);
            enhance();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
    }
    private void enhance() {
        System.out.println("一根烤肠");
    }
}
